/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sapra.dep.echo.CambioFecha;

import nextapp.echo2.app.Extent;


/**
 * Generated Echo form template
 * 
 * @author ppratsc
 */
public class Aviso extends nextapp.echo2.app.WindowPane {

    public Aviso(String title,String msg) {
        super();
        setTitle(title);
        setModal(true);
        setClosable(false);
        setHeight(new Extent(202,Extent.PX));
        setResizable(false);
        add(new AvisoContentPane(msg));
    }
    
    private class AvisoContentPane extends nextapp.echo2.app.ContentPane{
    
        public AvisoContentPane(String msg) {
            super();
            initComponents();

            m_LabMsg.setText(msg);
        }

        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {

            column1 = new nextapp.echo2.app.Column();//GEN-BEGIN:init_components
            m_LabMsg = new nextapp.echo2.app.Label();
            m_BtnOK = new nextapp.echo2.app.Button();
            
            setBackground(nextapp.echo2.app.Color.ORANGE);
            
            add(column1);
            
            column1.setCellSpacing(new nextapp.echo2.app.Extent(
                    20,
                    nextapp.echo2.app.Extent.PX));
            
            column1.setInsets(new nextapp.echo2.app.Insets(
                    new nextapp.echo2.app.Extent(10, nextapp.echo2.app.Extent.PX),
                    new nextapp.echo2.app.Extent(20, nextapp.echo2.app.Extent.PX),
                    new nextapp.echo2.app.Extent(10, nextapp.echo2.app.Extent.PX),
                    new nextapp.echo2.app.Extent(20, nextapp.echo2.app.Extent.PX)));
            
            column1.setLocale(new java.util.Locale(
                    "en",
                    "US"));
            
            column1.add(m_LabMsg);
            column1.add(m_BtnOK);
            
            m_LabMsg.setFont(new nextapp.echo2.app.Font(
                    nextapp.echo2.app.Font.SANS_SERIF,
                    nextapp.echo2.app.Font.PLAIN,
                    new nextapp.echo2.app.Extent(16, nextapp.echo2.app.Extent.PX)));
            
            m_LabMsg.setText("EMPTY");
            
            m_LabMsg.setTextAlignment(new nextapp.echo2.app.Alignment(
                    nextapp.echo2.app.Alignment.CENTER,
                    nextapp.echo2.app.Alignment.CENTER));
            
            m_LabMsg.setTextPosition(new nextapp.echo2.app.Alignment(
                    nextapp.echo2.app.Alignment.CENTER,
                    nextapp.echo2.app.Alignment.CENTER));
            
            nextapp.echo2.app.layout.ColumnLayoutData m_LabMsg_Ld =
                    new nextapp.echo2.app.layout.ColumnLayoutData();
            m_LabMsg_Ld.setAlignment(new nextapp.echo2.app.Alignment(
                    nextapp.echo2.app.Alignment.CENTER,
                    nextapp.echo2.app.Alignment.CENTER));
            m_LabMsg.setLayoutData(m_LabMsg_Ld);
            
            
            m_BtnOK.setAlignment(new nextapp.echo2.app.Alignment(
                    nextapp.echo2.app.Alignment.CENTER,
                    nextapp.echo2.app.Alignment.BOTTOM));
            
            m_BtnOK.setStyleName("Default");
            
            m_BtnOK.setText("OK");
            
            nextapp.echo2.app.layout.ColumnLayoutData m_BtnOK_Ld =
                    new nextapp.echo2.app.layout.ColumnLayoutData();
            m_BtnOK_Ld.setAlignment(new nextapp.echo2.app.Alignment(
                    nextapp.echo2.app.Alignment.CENTER,
                    nextapp.echo2.app.Alignment.CENTER));
            m_BtnOK.setLayoutData(m_BtnOK_Ld);
            
            m_BtnOK.addActionListener(new nextapp.echo2.app.event.ActionListener(){
                public void actionPerformed(nextapp.echo2.app.event.ActionEvent evt) {
                    onOK(evt);
                }
            });//GEN-END:init_components

        }// </editor-fold>


        // Action listeners//GEN-LINE:listeners_area

        private void onOK(nextapp.echo2.app.event.ActionEvent evt) {//GEN-FIRST:onOK_nextapp.echo2.app.event.ActionEvent
            Aviso win = (Aviso)getParent();
            win.userClose();
        }//GEN-LAST:onOK_nextapp.echo2.app.event.ActionEvent



        // Variables declaration - do not modify//GEN-BEGIN:variables_declaration
        private nextapp.echo2.app.Column column1;
        private nextapp.echo2.app.Label m_LabMsg;
        private nextapp.echo2.app.Button m_BtnOK;//GEN-END:variables_declaration

    }
}

